# coding: utf-8

import json


from common.constant import ASSIGN_RED_PACKET_QUEUE
from common.producer import Producer
from common.schedule.opc_celery import celery_app


@celery_app.task(name='red_packet_expired_task')
def red_packet_expired_task(red_packet_id):
    """
    create by ld_wu 2018-07-25
    向红包过期消费者推送过期任务
    """
    producer = Producer(ASSIGN_RED_PACKET_QUEUE)
    producer.send(
        json.dumps(dict(
            func='expired_red_packet',
            args=(),
            kwargs=dict(
                red_packet_id=red_packet_id
            )
        ))
    )
